# $Id$
# Maintainer: Eric Bélanger <eric@archlinux.org>

pkgname=lcms2
pkgver=2.8
pkgrel=2
pkgdesc="Small-footprint color management engine, version 2"
arch=('i686' 'x86_64')
url="http://www.littlecms.com"
license=('MIT')
depends=('libtiff')
source=(http://downloads.sourceforge.net/sourceforge/lcms/${pkgname}-${pkgver}.tar.gz
        CVE-2016-10165.patch::"https://github.com/mm2/Little-CMS/commit/5ca71a7b.patch")
sha1sums=('e9535ec4a572b8fc7a1c405c35e6f4dc97714197'
          '6b7a55efd9914bf53665088c019d62f976ff028b')

prepare() {
  cd $pkgname-$pkgver
  patch -p1 -i ../CVE-2016-10165.patch
}

build() {
  cd ${pkgname}-${pkgver}
  ./configure --prefix=/usr
  make
}

check() {
  cd ${pkgname}-${pkgver}
  make check
}

package() {
  cd ${pkgname}-${pkgver}
  make DESTDIR="${pkgdir}" install
  install -Dm644 COPYING "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}
